package com.lvhaosb.newpneumonia.tools;

import com.lvhaosb.newpneumonia.POJO.po.DomesticEpidemic;

import java.time.LocalDateTime;

/**
 * 类型 工具
 */
public class TypeTool {

    /**
     * 将 object1 转换成 object2
     * 目前仅支持string to time
     *
     * @param object1
     * @param object2
     * @return
     * @throws ClassNotFoundException
     */
    public Object autoChangeType(Object object1, Object object2) {

        /**
         * string to localdatetime
         */
        if(object1 instanceof String && object2 instanceof LocalDateTime){
            TimeTool timeTool = new TimeTool();
            return timeTool.stringToLocalDateTime((String)object1);
        }

        return object1;
    }

}
